<?php 
function checkFile($prefix, $name){
	$res = false;
	$file =  "{$prefix}/{$name}.php";
	
	if(is_file($file)){
		include_once $file;
		$res = true; 
	}
	
	return $res;
}

function __autoload($name) {
	$current = strtolower($name);
	
	return 
		checkFile("pages", $current) ||
			checkFile("pages/controller", $current) ||
			checkFile("pages/form", $current) ||
			checkFile("server", $current) ||
			checkFile("util", $current) ||
			checkFile("data", $current) ;
}
?>